<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sijyp="http://java.sun.com/jsf/composite/sijyp">
	
	<br />
	<h:panelGroup id="asociar_cadaveres_detalle_tabla">
		#{msgExh['exhumaciones.diligencia.cadaver.tabla_cadaveres']}
			<hr width="100%" />
	<br />
	<a4j:outputPanel id="cadaveres">
		<a4j:region id="rg_cadaveres">
			<rich:dataTable id="dt_cadaveres" keepSaved="true" rowKeyVar="index"
				var="record" noDataLabel="${msg['general.registrosNoEncontrados']}"
				value="#{managedBean.cadaveresDm.dataModel}" rows="10">
				<ui:include src="/resources/sijyp/dataModels/column.xhtml">
					<ui:param name="render_sort" value="dt_cadaveres" />
					<ui:param name="key" value="numero_caso" />
					<ui:param name="header"
						value="#{msgExh['exhumaciones.diligencia.id_caso']}" />
					<ui:param name="column" value="4" />
					<ui:param name="managedBean" value="#{managedBean.cadaveresDm}" />
				</ui:include>
				<ui:include src="/resources/sijyp/dataModels/column.xhtml">
					<ui:param name="render_sort" value="dt_cadaveres" />
					<ui:param name="key" value="numero_fosa" />
					<ui:param name="header"
						value="#{msgExh['exhumaciones.diligencia.registrar.resultado.exhumacion.fosa.numero']}" />
					<ui:param name="column" value="1" />
					<ui:param name="managedBean" value="#{managedBean.cadaveresDm}" />
				</ui:include>
				<ui:include src="/resources/sijyp/dataModels/column.xhtml">
					<ui:param name="render_sort" value="dt_cadaveres" />
					<ui:param name="key" value="numero_acta" />
					<ui:param name="header"
						value="#{msgExh['exhumaciones.informes.laboratorio.numero_acta']}" />
					<ui:param name="column" value="2" />
					<ui:param name="managedBean" value="#{managedBean.cadaveresDm}" />
				</ui:include>
				<rich:column>
					<f:facet name="header">
						<h:outputLabel
							value="${msg['bienes.origen.deOficio.tabla.acciones']}" />
					</f:facet>
					<h:panelGrid columns="3"
						columnClasses="icon_space,icon_space,icon_space,icon_space,icon_space">

						<h:commandLink action="#{managedBean.editar(record[3])}"
							disabled="#{parentMb.estado == 'VER'}">
							<h:graphicImage value="/resources/images/icons/ico_pencil.png"
								title="${msg['boton.editar']}"
								rendered="#{parentMb.estado != 'VER'}" />
							<h:graphicImage
								value="/resources/images/icons/ico_pencil_gray.png"
								title="${msg['boton.editar']}"
								rendered="#{parentMb.estado == 'VER'}" />
							<f:ajax
								render="frm_registro_cadaver:pnl_registro_cadaver frm_registro_cadaver:detalle"
								disabled="#{parentMb.estado == 'VER'}" />
						</h:commandLink>

						<h:commandLink action="#{managedBean.ver(record[3])}">
							<h:graphicImage value="/resources/images/icons/ico_details.png"
								title="${msg['boton.consultar']}"
								rendered="#{parentMb.estado != 'VER'}" />
							<h:graphicImage
								value="/resources/images/icons/ico_details_gray.png"
								title="${msg['boton.consultar']}"
								rendered="#{parentMb.estado == 'VER'}" />
							<f:ajax
								render="frm_registro_cadaver:pnl_registro_cadaver frm_registro_cadaver:detalle" />
						</h:commandLink>

						<h:commandLink value="" action="#{managedBean.setCadaverId(record[3])}"
							disabled="#{managedBean.disableMainEliminar or parentMb.estado == 'VER'}"
							onclick="#{rich:component('cadaver_confirmar_eliminar')}.show()">
							<h:graphicImage value="/resources/images/icons/ico_delete.png"
								title="#{msg['boton.eliminar']}"
								rendered="#{parentMb.estado != 'VER' and !managedBean.disableMainEliminar}" />
							<h:graphicImage
								value="/resources/images/icons/ico_delete_disabled.png"
								title="${msg['boton.aceptar']}"
								rendered="#{parentMb.estado == 'VER' or managedBean.disableMainEliminar}" />
							<f:ajax disabled="#{parentMb.estado == 'VER'}" />
						</h:commandLink>
					</h:panelGrid>
				</rich:column>
				<f:facet name="footer">
							<rich:dataScroller   maxPages="10"
								fastStep="5"
								fastControls="hide" stepControls="show">
							</rich:dataScroller>
						</f:facet>
			</rich:dataTable>
		</a4j:region>

		<a4j:region>
			<sijyp:confirmDialog message="#{msg['general.confirmaBorrar']}"
				confirmId="cadaver_confirmar_eliminar"
				renderComponents="frm_registro_cadaver:pnl_registro_cadaver frm_registro_cadaver:detalle"
				acceptAction="#{registrarCadaveres.eliminar}" />
		</a4j:region>
	</a4j:outputPanel>
	</h:panelGroup>

</ui:composition>